function reducer(...args: Array<number>) {
  return args.reduce((prev, current) => prev + current, 0);
}

let total = reducer(1, 2, 3, 4);
console.log(total);
